package com.haiersen.sign.user;

import java.util.Map;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.haiersen.sign.user.service.IUserService;

/**
 * 用户Controller
 * @author Rick
 * 
 */
@Controller
@RequestMapping("/user")
public class UserController {
	@Autowired
	private IUserService userService;

	/**
	 * app用户登录,不拦截
	 * @param phone 手机号
	 * @param password  密码
	 * @return
	 */
	@RequestMapping(value = "/login", method = RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> login(
			@RequestParam("phone") @NotBlank String phone,
			@RequestParam("password") @NotBlank String password){
		return userService.updatelogin(phone, password);
	}
}
